/*
 * BanBu_ChatViewController
 * @description 本文件提供对话界面的viewcontroller
 * @package
 * @author 		***
 * @copyright
 * @version 		1.0
 * @description 本文件提供对话界面的viewcontroller
 */

#import <UIKit/UIKit.h>
#import "BanBu_SmileView.h"
#import "CFCube.h"
#import "BanBu_LocationManager.h"
#import "AppCommunicationManager.h"
#import "AppDataManager.h"
#import "TKLoadingView.h"
#import "RecordView.h"
#import "BanBu_MakeBigMapViewController.h" 
#import "BanBu_HeaderView.h"
#import "BanBu_SmallListView.h"

#import "BanBu_MaskView.h"
#import "JSMessageInputView.h"
#import <MediaPlayer/MediaPlayer.h>
#import "BanBu_ReportView.h"
#import "BanBu_SnapImageView.h"
#import "BanBu_SnowView.h"
#import "BanBu_AlertView.h"
#import "BanBu_ChatCellAPI.h"
#import "BanBu_ChatSmileCell.h"
#import "BanBu_EmoKeyboard.h"
#import "BanBu_ManuscriptAPI.h"
#import "BanBu_UMengShareManager.h"
#import "MBProgressHUD.h"
#import "QuadCurveMenu.h"
@class BanBu_VideoViewCell;

@class UIBadgeView;
@class BanBu_FriendListController;
@class BanBu_TitleView;

typedef enum {
    
    ChatCellTypeTextd = 0,
    ChatCellTypeImaged,
    ChatCellTypeLocationd,
    ChatCellTypeVoiced,
    ChatCellTypeEmid
    
} ChatCellTyped;

@interface BanBu_ChatViewController : UIViewController <UITextViewDelegate,BanBu_SmileViewDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate,BanBu_LocationManagerDelegate,UITableViewDataSource,UITableViewDelegate,CFCubeDelegate,BanBuRequestDelegate,RecordViewDelegate,UIActionSheetDelegate,UIAlertViewDelegate,FHSTwitterEngineAccessTokenDelegate,ReportViewDelegate,UIWebViewDelegate,JSMessageInputViewDelegate,UIPickerViewDataSource,UIPickerViewDelegate,AlertDelegate,SnowViewDelegate,BanBu_ChatDelegate,BanBu_EmoKeyboardDelegate,MBProgressHUDDelegate,QuadCurveMenuDelegate>
{
    //zyfzyfzyf⬇️
    //分享界面
    QuadCurveMenu * _menu;
    MBProgressHUD * _hud;
    //20141020
    NSMutableString * _shortUrl;
    //zyfzyfzyf⬆️

    //zyfzyfzyf⬆️

    CFCube *_inputBar;
    UIView *_topBar; 
    JSMessageInputView *_inputView;

    UIButton *_plusButton;
    UIButton *_smileButton;
    UIButton *_actionButton;
    UIButton *_plusButton2;
    UIButton *_smileButton2;
    UIButton *_actionButton2;
    UIButton *_timeButton;    //定时Button
    UILabel * _timeLabel;
    UIPickerView *_timePicker;
    
    RecordView *_recordView;
    
    BOOL _showMenu;
    BOOL _firstHere; //是不是第一次进入本界面
    BanBu_SmileView *_smileView;//表情键盘
    
    BOOL _showSmile;
    UIView *_headerView;
    
    //需要把录音按钮设置为全局变量，自动结束录音需要使用
    UIButton *voiceButton;
}
- (id)initWithPeopleProfile:(NSDictionary *)profile;

//调整tableView的frame
- (void)tableViewAutoOffset;

//关闭语音
-(BOOL)stopLastVoiceView:(int)row;
//关闭键盘等输入设备
- (void)tapped:(BanBu_MaskView *)maskView;
-(void)popself;

@property (nonatomic,retain) BanBu_TitleView *titleView;    //导航的标题

@property (retain, nonatomic) UIActivityIndicatorView * activityIndicator;
@property (assign, nonatomic) BOOL refreshTable;

@property (nonatomic, retain) NSURLConnection *connection;//tencent
@property (nonatomic, retain) UITableView *tableView;
@property (nonatomic, retain) NSDictionary *profile;

@property (nonatomic, copy)   NSString *chatStringDefault;//从相册跳转过来的带有这个参数，为默认对话文字

@property (nonatomic, retain) NSMutableArray *latiArr;//存储经纬度

@property (nonatomic, assign) int rowt;             //选中行的row
@property (nonatomic, assign) ChatCellTyped type;   //选中行的type
@property (nonatomic, assign) BOOL hidHeader;      //设置是否显示tableHeaderView
@property (assign, nonatomic) BOOL isStayInChatPage;//是否停留在聊天界面，YES为时聊天界面，NO为离开聊天界面
@property (assign, nonatomic) BOOL firstSayHi;      //给第一个打招呼回复
@property (assign, nonatomic) BOOL isBlack;         //拉黑成功

#pragma mark - 键盘部分
@property (assign, nonatomic) CGFloat previousTextViewContentHeight;//输入框上一次的高度
@property (assign, nonatomic) BOOL sendtext;    //是否发送过消息（输入时为NO，发送后为YES，再输入时为NO）

@property (retain, nonatomic) BanBu_SmileView * smileViewBackup;
@property (assign, nonatomic) BOOL isShowSound;     //用在点击“声音”号时，显示输入框图标还是显示“声音”图标
@property (assign, nonatomic) BOOL isShowPlus;      //用在点击“+”号按钮时，是否显示键盘图标
@property (assign, nonatomic) BOOL isShowSmile;     //是否显示“笑脸”图标，显示“笑脸”，说明显示界面不是显示的“表情”

@property (assign, nonatomic) BOOL isColseKeyboard; //YES：可以开启、关闭键盘；NO：不能开启、关闭键盘；防止在其他界面打字时影响聊天的键盘
@property (assign, nonatomic) BOOL isCloseInputBar; //是否让inputBar跟随键盘隐藏而隐藏；
@property (assign, nonatomic) BanBu_EmoKeyboard * keyboardview;

-(void)resetKeyboard;
#pragma mark - 返回按钮及气泡
@property (retain, nonatomic) NSString * returnBtTitle;//进入对话时返回按钮显示的title；
@property (nonatomic, retain) NSString * badgeValue;
@property (retain, nonatomic) UIBadgeView * badgeView;//返回按钮的气泡

- (void)setBadgeValue:(NSString *)badgeValue withButtonIndex:(NSInteger)_index;
//创建返回按钮
- (UIBarButtonItem*)createBackButton;

#pragma mark - 设置背景
@property (retain, nonatomic) UIImageView * bkView;      //静态背景
@property (retain, nonatomic) SCGIFImageView * bKGIFView;//动态背景
-(void)setBGImage;
-(void)setLoading:(NSNumber *)index;


#pragma mark - 阅后即焚使用的变量
@property (retain, nonatomic) BanBu_SnapImageView * snapImageView;//阅后即焚的图片
@property (retain, nonatomic) MPMoviePlayerController * movieController;//阅后即焚的视频
@property (assign, nonatomic) BanBu_VideoViewCell * cell;        //长按行

@property (retain, nonatomic) NSArray * timeArray;  //时间数组

#pragma mark -新消息显示到界面上
//将消息显示到界面上
-(void)insertInToTable:(NSArray *)amsgList;
//将消息显示到界面上
-(void)insertInToTableByMySelf:(NSArray *)amsgList;

//显示彩蛋
-(void)showSnowView:(NSString *)imagePath musicPath:(NSString *)musicPath;

@property (assign, nonatomic)BOOL showEggs;//正在播放彩蛋
@property (retain, nonatomic)NSArray * eggArray;//可以播放
@property (retain, nonatomic)NSString * content;
@end
